'''
Created on 26/03/2009

@author: eh01
'''
from urllib2 import URLError
import base64
import unittest
import urllib2


class Test(unittest.TestCase):


    def setUp(self):
        pass


    def tearDown(self):
        pass


    def test_get_message_case1(self):
        username = '' # Put in username here
        password = '' # Put in password here
        base64string = base64.encodestring(
                '%s:%s' % (username, password))[:-1]
        authheader =  "Basic %s" % base64string
        request = urllib2.Request("http://localhost:8080/node/100/53")
#        request = urllib2.Request("http://eplanning-vic-au.appspot.com/node/1")
        request.add_header("Authorization", authheader)
        try:
            response = urllib2.urlopen(request)
            xml_string = response.read()
            print xml_string
        except URLError, e:
            print e.code        


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.test_get_message_case1']
    unittest.main()